<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
		<script type="text/javascript" src="js/jquery-1.8.1.min.js"></script>
		<script type="text/javascript">
			$(function(){
				addOption($('#year'),1940,2016);
				addOption($('#month'),1,12);
				addOption($('#day'),1,31);
				$("#year,#month").change(function(){
					var m = parseInt($("#month").val());
					$("#day option:gt(27)").remove();
					switch(m){
						case 1:
						case 3:
						case 5:
						case 7:
						case 8:
						case 10:
						case 12:addOption($("#day"),29,31);break;
						case 4:
						case 6:
						case 9:
						case 11:addOption($("#day"),29,30);break;
						case 2:var y = parseInt($("#year").val());
						if(y%4==0&&y%100!=0 || y%400==0){
							$("#day").append("<option>29</option>");
						}
						break;
					}
				});
			});
			
			function addOption(obj,start,end){
				for(var i=start;i<=end;i++){
					obj.append("<option>"+i+"</option>");
				}
			}
			
			
		</SCRIPT>

	</head>
	<body>
	<form action="">
		<select id="year" name="year"></select>年
		<select id="month" name="month"></select>月
		<select id="day" name="day"></select>日
		<input type="submit" value="提交注册"/>
	</form>
		
	</body>
</html>